<template>
	<view>
		<view class="conpon_detail">
			<view class="cashCoupon">
				<view class="my__coupon">
					<view class="securities">
						<view class="coupon kfbt">
							<view class="logo_img box">
								<image :src="coupon.image_url"></image>
							</view>
							<view class="coupon__r">
								<view class="coupon__content">
									<view class="coupon__price" v-if="coupon.coupon_type == 'CASH'">
										<template v-if="coupon.plantype == 'D'">
											￥
											<text>{{coupon.price}}</text>
											<view class="orprice">原价：{{coupon.amount}}元</view>
										</template>
										<template v-else>
											￥
											<text>{{coupon.amount}}</text>
										</template>
									</view>
									<view class="coupon__discount" v-else-if="coupon.coupon_type == 'DISCOUNT'">
										<text>{{coupon.rebate}}</text>折
									</view>
									<view class="mydesc flex">
										<view class="coupon__tit">{{coupon.act_name || ''}}</view>
										<view class="coupon__sub">{{coupon.explain != null ? coupon.explain : '1'}}</view>
									</view>
								</view>
								<view class="coupon_term" v-if="coupon.time_limit_type == 'custom'">{{coupon.time_show}}</view>
								<view class="coupon_term" v-else>有效期：{{coupon.startdate}} 至 {{coupon.enddate}}</view>
							</view>
							<view class="coupon_abs">
								<button class="kfbt mybtn pastTime li used_btn" v-if="coupon.status === 'ED'">已被抢完</button>
								<button class="kfbt mybtn pastTime li used_btn" v-else-if="coupon.status === 'NS'">即将开抢</button>
								<button class="kfbt mybtn coupon_btn" v-else>
									<view class="price vbi box" v-if="coupon.plantype=='D'">
										<block v-if="coupon.price">
											<text>积</text>
											<text>分</text>
											<text>&</text>
											<text>现</text>
											<text>金</text>
										</block>
										<block v-else>
											免费领取
										</block>
									</view>
									<view class="price box box-pack-center box-align-center" v-else>
										<block v-if="coupon.price">
											<text>{{coupon.price}}</text>
											<image src="/static/images/icon_nonedou.png"></image>
											<text>兑</text>
											<text>换</text>
										</block>
										<block v-else>
											免费
										</block>
									</view>
								</button>
							</view>
						</view>
					</view>
				</view>
			</view>
		</view>
	</view>
</template>

<script>
	export default {
		props: [
			"coupon"
		]
	}
</script>

<style lang="scss">
	@import url("../../static/styles/couponlist.css");

	.cashCoupon .my__coupon .coupon {
		margin-top: 0;
	}
</style>
